<%@page import="java.util.Calendar"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<%
  pageContext.setAttribute("APP_PATH", request.getContextPath());
%>
<script type="text/javascript" src="${APP_PATH}/static/js/jquery-1.12.4.min.js"></script>
<link href="${APP_PATH}/static/bootstrap-3.3.7-dist/css/bootstrap.min.css" rel="stylesheet"/>
<script src="${APP_PATH}/static/bootstrap-3.3.7-dist/js/bootstrap.min.js" ></script>
<script type="text/javascript">
$(document).ready(function(){
       //alert(1);
});
function getTime(){
    var Week, Weekday;
    var date =  new Date();
    Week = ["星期天", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"];
    Weekday = date.getDay(); 
    year = date.getFullYear();
    month = date.getMonth() + 1;
    day = date.getDate();
    hours = date.getHours();
    minutes = date.getMinutes();
    seconds = date.getSeconds(); 
    document.getElementById("getTime").innerHTML = "当前时间："+year + "年" + month + "月" + day + "日" + "\t" + hours + ":" + minutes + ":" + seconds + "\t" + Week[Weekday];
};
setInterval("getTime()",1000);
</script>

</head>
</head>
<body>

  <!-- 显示页面  使用 bootstrap -->
    <div class="container">
        <!-- 标题 -->
      <div class="row">
      <div style="float:left">
        <div class="col-md-12" >
        <h1>常见问题</h1>
       <h5 id="getTime"> </h5>
        </div>
          <!--按钮 -->
			<div class="col-lg-6">
				<div class="input-group">
					<input type="text" class="form-control" placeholder="Search for...">
					<span class="input-group-btn">
						<button class="btn btn-default" type="button">Go!</button>
					</span>
				</div>
			</div>
			</div>
        <div style="float:left">
         <!--导航 -->
		 <ul class="nav nav-pills nav-stacked">
		  <li role="presentation" class="active"><a href="#">本页目录</a></li>
		  <li role="presentation"><a href="#">项目FQA</a></li>
		  <li role="presentation"><a href="#">最新发布</a></li>
		  <li role="presentation"><a href="#">相关文档</a></li>
		</ul>
		</div>
      </div>

		<!-- 显示表格数据-->
      <div class="row">
        <div class="col-md-12">
        <h2>项目FQA</h2>
          <table class="table table-hover" id="questionAll_table">
          <tbody>
             
          </tbody>
          </table>
      </div>
      </div>
      	<!-- 显示表格数据-->
      <div class="row">
        <div class="col-md-12">
        <h2>最新发布</h2>
          <table class="table table-hover" id="questionAll_table">
          <tbody>
             
          </tbody>
          </table>
      </div>
      </div>

      	<!-- 显示表格数据-->
      <div class="row">
        <div class="col-md-12">
        <h2>相关文档</h2>
          <table class="table table-hover" id="questionAll_table">
          <tbody>
             
          </tbody>
          </table>
      </div>
      </div>
      </div>
      
 <script type="text/javascript">
       //页面加载完毕后，发送ajax请求
      $(function(){
    	  $.ajax({
    		  url:"${APP_PATH}/getAllQuestionAll",
    		  data:"pn=1",
    		  type:"GET",
    		  success:function(result){
    			//1. 解析并显示员工数据
      			//console.log(result);
      			build_questionAll_table(result);
    		  }
    	  });
      })
    
 
      function build_questionAll_table(result){
   	   //清空表格
   	   $("#questionAll_table tbody").empty();
   	   var questionAll=result.extend.pageInfo.list;
   	   $.each(questionAll,function(index,item){
   		   var questionNameTd=$("<li></li>").append($("<a></a>").append(item.questionName).attr("href","#"));
   		   $("<ul></ul>")
   		   .append(questionNameTd)
   		   .appendTo("#questionAll_table tbody");
   	   });
      }
    
</script>
</body>
</html>